/*
 * anima/thread.hh - Generic thread interface.
 * Copyright (C) 2007  Mikhail Vorozhtsov
 * See the LICENSE section of the README file for details.
 */

/* $Id$ */

#ifndef HEADER_ANIMA_THREAD_HH
#define HEADER_ANIMA_THREAD_HH

#include ANIMA_ARCH_HEADER (thread.hh)
#include HEADER (anima,object.hh)

START_NAMESPACE (anima)

struct thread_t : public object_t, ANIMA_ARCH::thread_t
{
  friend class cpu_t;
  friend class space_t;

private:
  cpu_ref_t cpu;
  space_t *space;

private:
  thread_t *prev_cpu;
  thread_t *next_cpu;
  thread_t *prev_space;
  thread_t *next_space;

public:
  static thread_t *create (space_t *space);

private:
  bool init_instance (space_t *space);

public:
  void set_ip (u64_t addr);
};

END_NAMESPACE

#endif /* HEADER_ANIMA_THREAD_HH */

